import React,{Component} from 'react';
import {Menu, Button} from 'antd';
import {Link} from 'react-router-dom';
export default class IndexMenu extends Component{
	_go(path){
		this.props.history.push({
      pathname: path,
    })
	}
	render(){
		let menus = [
			{name: '首页', path: '/index/all'},
			{name: '精华', path: '/index/good'},
			{name: '问答', path: '/index/ask'},
			{name: '分享', path: '/index/share'},
			{name: '招聘', path: '/index/jop'},
			{name: '测试', path: '/index/dev'}
		];
		let {id, mode} = this.props;
		return(
			<Menu id={id} mode={mode}>
				{
					menus.map( (item) => 
						<Menu.Item id={item.path} key={item.path}>
							<Link to={item.path}>{item.name}</Link>
						</Menu.Item>
					)
				}
			</Menu>
		)
	}
}